#include "TI_C2000_MotorControl_acc.h"
#include "TI_C2000_MotorControl_acc_types.h"
#include "mwmathutil.h"
#include <string.h>
#include <math.h>
#include "rtwtypes.h"
#include "TI_C2000_MotorControl_acc_private.h"
#include <stdio.h>
#include "slexec_vm_simstruct_bridge.h"
#include "slexec_vm_zc_functions.h"
#include "slexec_vm_lookup_functions.h"
#include "slsv_diagnostic_codegen_c_api.h"
#include "simtarget/slSimTgtMdlrefSfcnBridge.h"
#include "simstruc.h"
#include "fixedpoint.h"
#define CodeFormat S-Function
#define AccDefine1 Accelerator_S-Function
#include "simtarget/slAccSfcnBridge.h"
void rt_ssGetBlockPath ( void * S , int_T sysIdx , int_T blkIdx , char_T * *
path ) { _ssGetBlockPath ( ( SimStruct * ) S , sysIdx , blkIdx , path ) ; }
void rt_ssSet_slErrMsg ( void * S , void * diag ) { SimStruct * castedS = (
SimStruct * ) S ; if ( ! _ssIsErrorStatusAslErrMsg ( castedS ) ) {
_ssSet_slErrMsg ( castedS , diag ) ; } else { _ssDiscardDiagnostic ( castedS
, diag ) ; } } void rt_ssReportDiagnosticAsWarning ( void * S , void * diag )
{ _ssReportDiagnosticAsWarning ( ( SimStruct * ) S , diag ) ; } void
rt_ssReportDiagnosticAsInfo ( void * S , void * diag ) {
_ssReportDiagnosticAsInfo ( ( SimStruct * ) S , diag ) ; } static void
mdlOutputs ( SimStruct * S , int_T tid ) { B_TI_C2000_MotorControl_T * _rtB ;
DW_TI_C2000_MotorControl_T * _rtDW ; P_TI_C2000_MotorControl_T * _rtP ;
real32_T tmp ; uint32_T B_7_97_776_0 ; _rtDW = ( ( DW_TI_C2000_MotorControl_T
* ) ssGetRootDWork ( S ) ) ; _rtP = ( ( P_TI_C2000_MotorControl_T * )
ssGetModelRtp ( S ) ) ; _rtB = ( ( B_TI_C2000_MotorControl_T * )
_ssGetModelBlockIO ( S ) ) ; if ( _rtDW -> DiscreteTimeIntegrator3_IC_LOADING
!= 0 ) { _rtDW -> DiscreteTimeIntegrator3_DSTATE = _rtB -> B_7_80_640 ; if (
_rtDW -> DiscreteTimeIntegrator3_DSTATE > _rtP -> P_1 ) { _rtDW ->
DiscreteTimeIntegrator3_DSTATE = _rtP -> P_1 ; } else if ( _rtDW ->
DiscreteTimeIntegrator3_DSTATE < _rtP -> P_2 ) { _rtDW ->
DiscreteTimeIntegrator3_DSTATE = _rtP -> P_2 ; } } _rtB -> B_7_0_0 = _rtDW ->
DiscreteTimeIntegrator3_DSTATE ; _rtB -> B_7_1_8 = _rtDW -> UnitDelay_DSTATE
; if ( _rtB -> B_7_1_8 >= _rtB -> B_7_74_592 ) { if ( _rtB -> B_7_1_8 <= _rtB
-> B_7_73_584 ) { _rtB -> B_7_2_16 = _rtB -> B_7_1_8 ; } else { _rtB ->
B_7_2_16 = _rtB -> B_7_1_8 - _rtP -> P_52 ; } } else { _rtB -> B_7_2_16 =
_rtB -> B_7_1_8 + _rtP -> P_53 ; } _rtB -> B_7_3_24 = _rtP -> P_4 * _rtB ->
B_7_2_16 ; muDoubleScalarSinCos ( _rtB -> B_7_3_24 , & _rtB -> B_7_4_32 , &
_rtB -> B_7_5_40 ) ; _rtB -> B_7_6_48 = _rtB -> B_7_0_0 * _rtB -> B_7_5_40 ;
if ( _rtDW -> DiscreteTimeIntegrator3_IC_LOADING_f != 0 ) { _rtDW ->
DiscreteTimeIntegrator3_DSTATE_d = _rtB -> B_7_88_704 ; if ( _rtDW ->
DiscreteTimeIntegrator3_DSTATE_d > _rtP -> P_6 ) { _rtDW ->
DiscreteTimeIntegrator3_DSTATE_d = _rtP -> P_6 ; } else if ( _rtDW ->
DiscreteTimeIntegrator3_DSTATE_d < _rtP -> P_7 ) { _rtDW ->
DiscreteTimeIntegrator3_DSTATE_d = _rtP -> P_7 ; } } _rtB -> B_7_7_56 = _rtDW
-> DiscreteTimeIntegrator3_DSTATE_d ; _rtB -> B_7_8_64 = _rtB -> B_7_7_56 *
_rtB -> B_7_4_32 ; _rtB -> B_7_9_72 = _rtB -> B_7_6_48 - _rtB -> B_7_8_64 ;
_rtB -> B_7_17_136 [ 0 ] = _rtB -> B_7_9_72 ; _rtB -> B_7_10_80 = _rtP -> P_8
* _rtB -> B_7_9_72 ; _rtB -> B_7_11_88 = _rtB -> B_7_0_0 * _rtB -> B_7_4_32 ;
_rtB -> B_7_12_96 = _rtB -> B_7_7_56 * _rtB -> B_7_5_40 ; _rtB -> B_7_13_104
= _rtB -> B_7_11_88 + _rtB -> B_7_12_96 ; _rtB -> B_7_14_112 = _rtP -> P_9 *
_rtB -> B_7_13_104 ; _rtB -> B_7_17_136 [ 1 ] = _rtB -> B_7_10_80 + _rtB ->
B_7_14_112 ; _rtB -> B_7_15_120 = _rtP -> P_10 * _rtB -> B_7_9_72 ; _rtB ->
B_7_16_128 = _rtP -> P_11 * _rtB -> B_7_13_104 ; _rtB -> B_7_17_136 [ 2 ] =
_rtB -> B_7_15_120 + _rtB -> B_7_16_128 ; ssCallAccelRunBlock ( S , 7 , 23 ,
SS_CALL_MDL_OUTPUTS ) ; _rtB -> B_7_20_160 = _rtDW ->
DiscreteTimeIntegrator_DSTATE ; _rtB -> B_7_21_168 = _rtP -> P_16 * _rtB ->
B_7_20_160 ; ssCallAccelRunBlock ( S , 7 , 26 , SS_CALL_MDL_OUTPUTS ) ;
ssCallAccelRunBlock ( S , 7 , 27 , SS_CALL_MDL_OUTPUTS ) ; _rtB -> B_7_22_176
= _rtB -> B_7_0_0 * _rtB -> B_7_7_56 ; _rtB -> B_7_23_184 = _rtB ->
B_7_22_176 * _rtB -> B_7_133_920 ; _rtB -> B_7_24_192 = _rtP -> P_17 * _rtB
-> B_7_7_56 ; _rtB -> B_7_25_200 = _rtB -> B_7_23_184 + _rtB -> B_7_24_192 ;
_rtB -> B_7_26_208 = _rtP -> P_18 * _rtB -> B_7_25_200 ; ssCallAccelRunBlock
( S , 7 , 33 , SS_CALL_MDL_OUTPUTS ) ; _rtB -> B_7_27_216 = _rtB ->
B_7_20_160 * _rtB -> B_7_128_900 ; _rtB -> B_7_28_224 = muDoubleScalarSign (
_rtB -> B_7_20_160 ) ; _rtB -> B_7_29_232 = _rtB -> B_7_127_896 * _rtB ->
B_7_28_224 ; _rtB -> B_7_30_240 = ( _rtB -> B_7_26_208 - _rtB -> B_7_27_216 )
- _rtB -> B_7_29_232 ; _rtB -> B_7_31_248 = _rtB -> B_7_30_240 / _rtB ->
B_7_126_892 ; _rtB -> B_7_32_256 = _rtP -> P_19 * _rtB -> B_7_20_160 ; _rtB
-> B_7_33_264 = _rtP -> P_20 * _rtB -> B_7_20_160 ; _rtB -> B_7_34_272 = _rtB
-> B_7_33_264 + _rtB -> B_7_2_16 ; _rtB -> B_7_35_280 = _rtP -> P_21 * _rtB
-> B_7_67_536 [ 0 ] ; _rtB -> B_7_36_288 = _rtP -> P_22 * _rtB -> B_7_67_536
[ 1 ] ; _rtB -> B_7_37_296 = _rtP -> P_23 * _rtB -> B_7_67_536 [ 2 ] ; _rtB
-> B_7_38_304 = ( _rtB -> B_7_35_280 + _rtB -> B_7_36_288 ) + _rtB ->
B_7_37_296 ; _rtB -> B_7_39_312 = _rtP -> P_24 * _rtB -> B_7_67_536 [ 1 ] ;
_rtB -> B_7_40_320 = _rtP -> P_25 * _rtB -> B_7_67_536 [ 2 ] ; _rtB ->
B_7_41_328 = _rtB -> B_7_39_312 + _rtB -> B_7_40_320 ; _rtB -> B_7_42_336 =
_rtB -> B_7_38_304 * _rtB -> B_7_5_40 ; _rtB -> B_7_43_344 = _rtB ->
B_7_41_328 * _rtB -> B_7_4_32 ; _rtB -> B_7_44_352 = _rtB -> B_7_42_336 +
_rtB -> B_7_43_344 ; _rtB -> B_7_45_360 = _rtB -> B_7_44_352 / _rtB ->
B_7_136_932 ; _rtB -> B_7_46_368 = _rtB -> B_7_32_256 * _rtB -> B_7_7_56 ;
_rtB -> B_7_47_376 = _rtB -> B_7_46_368 * _rtB -> B_7_139_944 / _rtB ->
B_7_140_948 ; _rtB -> B_7_48_384 = _rtB -> B_7_0_0 * _rtB -> B_7_141_952 /
_rtB -> B_7_144_964 ; _rtB -> B_7_49_392 = ( _rtB -> B_7_45_360 + _rtB ->
B_7_47_376 ) - _rtB -> B_7_48_384 ; _rtB -> B_7_50_400 = _rtB -> B_7_38_304 *
_rtB -> B_7_4_32 ; _rtB -> B_7_51_408 = _rtB -> B_7_41_328 * _rtB -> B_7_5_40
; _rtB -> B_7_52_416 = _rtB -> B_7_51_408 - _rtB -> B_7_50_400 ; _rtB ->
B_7_53_424 = _rtB -> B_7_52_416 / _rtB -> B_7_147_976 ; _rtB -> B_7_54_432 =
_rtB -> B_7_0_0 * _rtB -> B_7_32_256 ; _rtB -> B_7_55_440 = _rtB ->
B_7_54_432 * _rtB -> B_7_150_988 / _rtB -> B_7_151_992 ; _rtB -> B_7_56_448 =
_rtB -> B_7_32_256 * _rtB -> B_7_152_996 / _rtB -> B_7_155_1008 ; _rtB ->
B_7_57_456 = _rtB -> B_7_7_56 * _rtB -> B_7_156_1012 / _rtB -> B_7_159_1024 ;
_rtB -> B_7_58_464 = ( ( _rtB -> B_7_53_424 - _rtB -> B_7_55_440 ) - _rtB ->
B_7_56_448 ) - _rtB -> B_7_57_456 ; ramp_controller_Outputs_wrapper_accel ( &
_rtB -> B_7_162_1036 , & _rtB -> B_7_101_792 ) ; ssCallAccelRunBlock ( S , 7
, 67 , SS_CALL_MDL_OUTPUTS ) ; memcpy ( & _rtB -> B_7_169_1064 [ 0 ] , & _rtP
-> P_55 [ 0 ] , 1002U * sizeof ( real32_T ) ) ; _rtB -> B_7_102_796 = _rtP ->
P_56 * _rtB -> B_7_101_792 ; _rtB -> B_7_1179_5088 = ( _rtB -> B_7_102_796 <
0.0F ) ; _rtB -> B_7_1171_5072 = _rtB -> B_7_1179_5088 ; if ( _rtB ->
B_7_1171_5072 > 0 ) { tmp = muSingleScalarFloor ( _rtB -> B_7_102_796 ) ; if
( muSingleScalarIsNaN ( tmp ) || muSingleScalarIsInf ( tmp ) ) { tmp = 0.0F ;
} else { tmp = muSingleScalarRem ( tmp , 65536.0F ) ; } if ( tmp < 0.0F ) {
_rtB -> B_5_1178_5086 = ( int16_T ) - ( int16_T ) ( uint16_T ) - tmp ; } else
{ _rtB -> B_5_1178_5086 = ( int16_T ) ( uint16_T ) tmp ; } _rtB ->
B_5_164_1044 = _rtB -> B_5_1178_5086 ; _rtB -> B_7_103_800 = _rtB ->
B_7_102_796 - _rtB -> B_5_164_1044 ; srUpdateBC ( _rtDW ->
IfActionSubsystem_SubsysRanBC ) ; } else { tmp = truncf ( _rtB -> B_7_102_796
) ; if ( muSingleScalarIsNaN ( tmp ) || muSingleScalarIsInf ( tmp ) ) { tmp =
0.0F ; } else { tmp = muSingleScalarRem ( tmp , 65536.0F ) ; } if ( tmp <
0.0F ) { _rtB -> B_6_1177_5084 = ( int16_T ) - ( int16_T ) ( uint16_T ) - tmp
; } else { _rtB -> B_6_1177_5084 = ( int16_T ) ( uint16_T ) tmp ; } _rtB ->
B_6_163_1040 = _rtB -> B_6_1177_5084 ; _rtB -> B_7_103_800 = _rtB ->
B_7_102_796 - _rtB -> B_6_163_1040 ; srUpdateBC ( _rtDW ->
IfActionSubsystem1_SubsysRanBC ) ; } _rtB -> B_7_104_804 = _rtP -> P_57 *
_rtB -> B_7_103_800 ; tmp = truncf ( _rtB -> B_7_104_804 ) ; if (
muSingleScalarIsNaN ( tmp ) || muSingleScalarIsInf ( tmp ) ) { tmp = 0.0F ; }
else { tmp = muSingleScalarRem ( tmp , 65536.0F ) ; } if ( tmp < 0.0F ) {
_rtB -> B_7_1172_5074 = ( uint16_T ) - ( int16_T ) ( uint16_T ) - tmp ; }
else { _rtB -> B_7_1172_5074 = ( uint16_T ) tmp ; } _rtB -> B_7_1173_5076 [ 0
] = _rtP -> P_75 [ 0 ] ; B_7_97_776_0 = ( uint32_T ) _rtP -> P_75 [ 0 ] +
_rtB -> B_7_1172_5074 ; _rtB -> B_7_97_776 [ 0 ] = B_7_97_776_0 ; _rtB ->
B_7_105_808 [ 0 ] = _rtB -> B_7_169_1064 [ ( int32_T ) B_7_97_776_0 ] ; _rtB
-> B_7_1173_5076 [ 1 ] = _rtP -> P_75 [ 1 ] ; B_7_97_776_0 = ( uint32_T )
_rtP -> P_75 [ 1 ] + _rtB -> B_7_1172_5074 ; _rtB -> B_7_97_776 [ 1 ] =
B_7_97_776_0 ; _rtB -> B_7_105_808 [ 1 ] = _rtB -> B_7_169_1064 [ ( int32_T )
B_7_97_776_0 ] ; _rtB -> B_7_1173_5076 [ 2 ] = _rtP -> P_75 [ 2 ] ;
B_7_97_776_0 = ( uint32_T ) _rtP -> P_75 [ 2 ] + _rtB -> B_7_1172_5074 ; _rtB
-> B_7_97_776 [ 2 ] = B_7_97_776_0 ; _rtB -> B_7_105_808 [ 2 ] = _rtB ->
B_7_169_1064 [ ( int32_T ) B_7_97_776_0 ] ; _rtB -> B_7_1173_5076 [ 3 ] =
_rtP -> P_75 [ 3 ] ; B_7_97_776_0 = ( uint32_T ) _rtP -> P_75 [ 3 ] + _rtB ->
B_7_1172_5074 ; _rtB -> B_7_97_776 [ 3 ] = B_7_97_776_0 ; _rtB -> B_7_105_808
[ 3 ] = _rtB -> B_7_169_1064 [ ( int32_T ) B_7_97_776_0 ] ; _rtB ->
B_7_109_824 = _rtB -> B_7_105_808 [ 0 ] - _rtB -> B_7_105_808 [ 1 ] ; _rtB ->
B_7_110_828 = _rtB -> B_7_1172_5074 ; _rtB -> B_7_111_832 = _rtB ->
B_7_104_804 - _rtB -> B_7_110_828 ; _rtB -> B_7_112_836 = _rtB -> B_7_109_824
* _rtB -> B_7_111_832 ; _rtB -> B_7_113_840 = _rtB -> B_7_112_836 + _rtB ->
B_7_105_808 [ 1 ] ; _rtB -> B_7_114_844 = _rtB -> B_7_105_808 [ 2 ] - _rtB ->
B_7_105_808 [ 3 ] ; _rtB -> B_7_115_848 = _rtB -> B_7_114_844 * _rtB ->
B_7_111_832 ; _rtB -> B_7_116_852 = _rtB -> B_7_115_848 + _rtB -> B_7_105_808
[ 3 ] ; ssCallAccelRunBlock ( S , 7 , 89 , SS_CALL_MDL_OUTPUTS ) ; if ( _rtP
-> P_76 > _rtP -> P_77 ) { _rtB -> B_4_165_1048 [ 0 ] = _rtB -> B_7_161_1032
* _rtB -> B_7_116_852 + _rtB -> B_7_160_1028 * _rtB -> B_7_113_840 ; _rtB ->
B_4_165_1048 [ 1 ] = - ( _rtB -> B_7_160_1028 * _rtB -> B_7_116_852 - _rtB ->
B_7_161_1032 * _rtB -> B_7_113_840 ) ; } else { _rtB -> B_4_165_1048 [ 0 ] =
_rtB -> B_7_160_1028 * _rtB -> B_7_116_852 - _rtB -> B_7_161_1032 * _rtB ->
B_7_113_840 ; _rtB -> B_4_165_1048 [ 1 ] = _rtB -> B_7_161_1032 * _rtB ->
B_7_116_852 + _rtB -> B_7_160_1028 * _rtB -> B_7_113_840 ; } _rtB ->
B_4_167_1056 = _rtB -> B_4_165_1048 [ 0 ] ; _rtB -> B_4_168_1060 = _rtB ->
B_4_165_1048 [ 1 ] ; ssCallAccelRunBlock ( S , 7 , 91 , SS_CALL_MDL_OUTPUTS )
; UNUSED_PARAMETER ( tid ) ; } static void mdlOutputsTID1 ( SimStruct * S ,
int_T tid ) { B_TI_C2000_MotorControl_T * _rtB ; DW_TI_C2000_MotorControl_T *
_rtDW ; P_TI_C2000_MotorControl_T * _rtP ; _rtDW = ( (
DW_TI_C2000_MotorControl_T * ) ssGetRootDWork ( S ) ) ; _rtP = ( (
P_TI_C2000_MotorControl_T * ) ssGetModelRtp ( S ) ) ; _rtB = ( (
B_TI_C2000_MotorControl_T * ) _ssGetModelBlockIO ( S ) ) ; _rtB -> B_7_59_472
= _rtP -> P_26 ; _rtB -> B_7_65_520 = _rtP -> P_30 ; if ( _rtB -> B_7_65_520
>= _rtP -> P_31 ) { _rtB -> B_7_66_528 = _rtB -> B_7_65_520 ; } else { _rtB
-> B_7_66_528 = _rtB -> B_7_59_472 ; } _rtB -> B_7_70_560 = _rtP -> P_32 ;
_rtB -> B_7_71_568 = _rtP -> P_33 ; if ( _rtP -> P_27 < 0.0 ) { _rtB ->
B_7_94_752 [ 0 ] = _rtP -> P_27 ; _rtB -> B_7_94_752 [ 1 ] = _rtP -> P_27 ; }
else { if ( _rtP -> P_28 > 0.0 ) { _rtB -> B_7_94_752 [ 0 ] = _rtP -> P_28 ;
} else { _rtB -> B_7_94_752 [ 0 ] = 0.0 ; } if ( _rtP -> P_28 > 0.0 ) { _rtB
-> B_7_94_752 [ 1 ] = _rtP -> P_28 ; } else { _rtB -> B_7_94_752 [ 1 ] = 0.0
; } } _rtB -> B_7_117_856 [ 0 ] = _rtP -> P_58 [ 0 ] ; _rtB -> B_7_120_868 [
0 ] = _rtP -> P_59 [ 0 ] ; _rtB -> B_7_123_880 [ 0 ] = _rtP -> P_60 [ 0 ] ;
_rtB -> B_7_117_856 [ 1 ] = _rtP -> P_58 [ 1 ] ; _rtB -> B_7_120_868 [ 1 ] =
_rtP -> P_59 [ 1 ] ; _rtB -> B_7_123_880 [ 1 ] = _rtP -> P_60 [ 1 ] ; if (
_rtP -> P_27 < 0.0 ) { _rtB -> B_7_94_752 [ 2 ] = _rtP -> P_27 ; } else if (
_rtP -> P_28 > 0.0 ) { _rtB -> B_7_94_752 [ 2 ] = _rtP -> P_28 ; } else {
_rtB -> B_7_94_752 [ 2 ] = 0.0 ; } _rtB -> B_7_117_856 [ 2 ] = _rtP -> P_58 [
2 ] ; _rtB -> B_7_120_868 [ 2 ] = _rtP -> P_59 [ 2 ] ; _rtB -> B_7_123_880 [
2 ] = _rtP -> P_60 [ 2 ] ; _rtB -> B_7_60_480 = ( _rtB -> B_7_94_752 [ 1 ] +
_rtB -> B_7_94_752 [ 2 ] ) + _rtB -> B_7_94_752 [ 0 ] ; _rtB -> B_7_61_488 =
_rtP -> P_29 * _rtB -> B_7_60_480 ; _rtB -> B_7_62_496 = _rtB -> B_7_94_752 [
0 ] - _rtB -> B_7_61_488 ; _rtB -> B_7_63_504 = _rtB -> B_7_94_752 [ 1 ] -
_rtB -> B_7_61_488 ; _rtB -> B_7_64_512 = _rtB -> B_7_94_752 [ 2 ] - _rtB ->
B_7_61_488 ; _rtB -> B_7_67_536 [ 0 ] = _rtB -> B_7_62_496 * _rtB ->
B_7_66_528 ; _rtB -> B_7_67_536 [ 1 ] = _rtB -> B_7_63_504 * _rtB ->
B_7_66_528 ; _rtB -> B_7_67_536 [ 2 ] = _rtB -> B_7_64_512 * _rtB ->
B_7_66_528 ; _rtB -> B_7_72_576 = _rtP -> P_34 ; _rtB -> B_7_126_892 = _rtB
-> B_7_117_856 [ ( int32_T ) _rtB -> B_7_70_560 - 1 ] ; _rtB -> B_7_127_896 =
_rtB -> B_7_120_868 [ ( int32_T ) _rtB -> B_7_71_568 - 1 ] ; _rtB ->
B_7_128_900 = _rtB -> B_7_123_880 [ ( int32_T ) _rtB -> B_7_72_576 - 1 ] ;
_rtB -> B_7_73_584 = _rtP -> P_35 ; _rtB -> B_7_74_592 = _rtP -> P_36 ; _rtB
-> B_7_75_600 = _rtP -> P_37 ; _rtB -> B_7_76_608 = _rtP -> P_38 ; _rtB ->
B_7_79_632 = _rtP -> P_40 ; _rtB -> B_7_81_648 = _rtP -> P_41 ; _rtB ->
B_7_82_656 = _rtP -> P_42 ; _rtB -> B_7_83_664 = _rtP -> P_43 ; _rtB ->
B_7_141_952 = _rtP -> P_64 ; _rtB -> B_7_84_672 = _rtP -> P_44 ; _rtB ->
B_7_87_696 = _rtP -> P_46 ; _rtB -> B_7_89_712 = _rtP -> P_47 ; _rtB ->
B_7_90_720 = _rtP -> P_48 ; _rtB -> B_7_91_728 = _rtP -> P_49 ; _rtB ->
B_7_152_996 = _rtP -> P_68 ; _rtB -> B_7_92_736 = _rtP -> P_50 ; _rtB ->
B_7_156_1012 = _rtP -> P_70 ; _rtB -> B_7_129_904 [ 0 ] = _rtP -> P_61 [ 0 ]
; _rtB -> B_7_77_616 [ 0 ] = _rtP -> P_39 [ 0 ] ; _rtB -> B_7_134_924 [ 0 ] =
_rtP -> P_62 [ 0 ] ; _rtB -> B_7_137_936 [ 0 ] = _rtP -> P_63 [ 0 ] ; _rtB ->
B_7_142_956 [ 0 ] = _rtP -> P_65 [ 0 ] ; _rtB -> B_7_85_680 [ 0 ] = _rtP ->
P_45 [ 0 ] ; _rtB -> B_7_145_968 [ 0 ] = _rtP -> P_66 [ 0 ] ; _rtB ->
B_7_148_980 [ 0 ] = _rtP -> P_67 [ 0 ] ; _rtB -> B_7_153_1000 [ 0 ] = _rtP ->
P_69 [ 0 ] ; _rtB -> B_7_157_1016 [ 0 ] = _rtP -> P_71 [ 0 ] ; _rtB ->
B_7_129_904 [ 1 ] = _rtP -> P_61 [ 1 ] ; _rtB -> B_7_77_616 [ 1 ] = _rtP ->
P_39 [ 1 ] ; _rtB -> B_7_134_924 [ 1 ] = _rtP -> P_62 [ 1 ] ; _rtB ->
B_7_137_936 [ 1 ] = _rtP -> P_63 [ 1 ] ; _rtB -> B_7_142_956 [ 1 ] = _rtP ->
P_65 [ 1 ] ; _rtB -> B_7_85_680 [ 1 ] = _rtP -> P_45 [ 1 ] ; _rtB ->
B_7_145_968 [ 1 ] = _rtP -> P_66 [ 1 ] ; _rtB -> B_7_148_980 [ 1 ] = _rtP ->
P_67 [ 1 ] ; _rtB -> B_7_153_1000 [ 1 ] = _rtP -> P_69 [ 1 ] ; _rtB ->
B_7_157_1016 [ 1 ] = _rtP -> P_71 [ 1 ] ; _rtB -> B_7_131_912 = _rtB ->
B_7_129_904 [ ( int32_T ) _rtB -> B_7_75_600 - 1 ] ; _rtB -> B_7_132_916 =
_rtB -> B_7_129_904 [ ( int32_T ) _rtB -> B_7_76_608 - 1 ] ; _rtB ->
B_7_133_920 = _rtB -> B_7_131_912 - _rtB -> B_7_132_916 ; _rtB -> B_7_80_640
= _rtB -> B_7_77_616 [ ( int32_T ) _rtB -> B_7_79_632 - 1 ] ; _rtB ->
B_7_136_932 = _rtB -> B_7_134_924 [ ( int32_T ) _rtB -> B_7_81_648 - 1 ] ;
_rtB -> B_7_139_944 = _rtB -> B_7_137_936 [ ( int32_T ) _rtB -> B_7_82_656 -
1 ] ; _rtB -> B_7_140_948 = _rtB -> B_7_137_936 [ ( int32_T ) _rtB ->
B_7_83_664 - 1 ] ; _rtB -> B_7_144_964 = _rtB -> B_7_142_956 [ ( int32_T )
_rtB -> B_7_84_672 - 1 ] ; _rtB -> B_7_88_704 = _rtB -> B_7_85_680 [ (
int32_T ) _rtB -> B_7_87_696 - 1 ] ; _rtB -> B_7_147_976 = _rtB ->
B_7_145_968 [ ( int32_T ) _rtB -> B_7_89_712 - 1 ] ; _rtB -> B_7_150_988 =
_rtB -> B_7_148_980 [ ( int32_T ) _rtB -> B_7_90_720 - 1 ] ; _rtB ->
B_7_151_992 = _rtB -> B_7_148_980 [ ( int32_T ) _rtB -> B_7_91_728 - 1 ] ;
_rtB -> B_7_155_1008 = _rtB -> B_7_153_1000 [ ( int32_T ) _rtB -> B_7_92_736
- 1 ] ; _rtB -> B_7_93_744 = _rtP -> P_51 ; _rtB -> B_7_159_1024 = _rtB ->
B_7_157_1016 [ ( int32_T ) _rtB -> B_7_93_744 - 1 ] ; _rtB -> B_7_160_1028 =
_rtP -> P_72 ; _rtB -> B_7_161_1032 = _rtP -> P_73 ; _rtB -> B_7_162_1036 =
_rtP -> P_74 ; ssCallAccelRunBlock ( S , 7 , 156 , SS_CALL_MDL_OUTPUTS ) ;
UNUSED_PARAMETER ( tid ) ; }
#define MDL_UPDATE
static void mdlUpdate ( SimStruct * S , int_T tid ) {
B_TI_C2000_MotorControl_T * _rtB ; DW_TI_C2000_MotorControl_T * _rtDW ;
P_TI_C2000_MotorControl_T * _rtP ; _rtDW = ( ( DW_TI_C2000_MotorControl_T * )
ssGetRootDWork ( S ) ) ; _rtP = ( ( P_TI_C2000_MotorControl_T * )
ssGetModelRtp ( S ) ) ; _rtB = ( ( B_TI_C2000_MotorControl_T * )
_ssGetModelBlockIO ( S ) ) ; _rtDW -> DiscreteTimeIntegrator3_IC_LOADING = 0U
; _rtDW -> DiscreteTimeIntegrator3_DSTATE += _rtP -> P_0 * _rtB -> B_7_49_392
; if ( _rtDW -> DiscreteTimeIntegrator3_DSTATE > _rtP -> P_1 ) { _rtDW ->
DiscreteTimeIntegrator3_DSTATE = _rtP -> P_1 ; } else if ( _rtDW ->
DiscreteTimeIntegrator3_DSTATE < _rtP -> P_2 ) { _rtDW ->
DiscreteTimeIntegrator3_DSTATE = _rtP -> P_2 ; } _rtDW -> UnitDelay_DSTATE =
_rtB -> B_7_34_272 ; _rtDW -> DiscreteTimeIntegrator3_IC_LOADING_f = 0U ;
_rtDW -> DiscreteTimeIntegrator3_DSTATE_d += _rtP -> P_5 * _rtB -> B_7_58_464
; if ( _rtDW -> DiscreteTimeIntegrator3_DSTATE_d > _rtP -> P_6 ) { _rtDW ->
DiscreteTimeIntegrator3_DSTATE_d = _rtP -> P_6 ; } else if ( _rtDW ->
DiscreteTimeIntegrator3_DSTATE_d < _rtP -> P_7 ) { _rtDW ->
DiscreteTimeIntegrator3_DSTATE_d = _rtP -> P_7 ; } _rtDW ->
DiscreteTimeIntegrator_DSTATE += _rtP -> P_12 * _rtB -> B_7_31_248 ; if (
_rtDW -> DiscreteTimeIntegrator_DSTATE > _rtP -> P_14 ) { _rtDW ->
DiscreteTimeIntegrator_DSTATE = _rtP -> P_14 ; } else if ( _rtDW ->
DiscreteTimeIntegrator_DSTATE < _rtP -> P_15 ) { _rtDW ->
DiscreteTimeIntegrator_DSTATE = _rtP -> P_15 ; } UNUSED_PARAMETER ( tid ) ; }
#define MDL_UPDATE
static void mdlUpdateTID1 ( SimStruct * S , int_T tid ) { UNUSED_PARAMETER (
tid ) ; } static void mdlInitializeSizes ( SimStruct * S ) { ssSetChecksumVal
( S , 0 , 130699851U ) ; ssSetChecksumVal ( S , 1 , 1452886329U ) ;
ssSetChecksumVal ( S , 2 , 722246268U ) ; ssSetChecksumVal ( S , 3 ,
707653714U ) ; { mxArray * slVerStructMat = ( NULL ) ; mxArray * slStrMat =
mxCreateString ( "simulink" ) ; char slVerChar [ 10 ] ; int status =
mexCallMATLAB ( 1 , & slVerStructMat , 1 , & slStrMat , "ver" ) ; if ( status
== 0 ) { mxArray * slVerMat = mxGetField ( slVerStructMat , 0 , "Version" ) ;
if ( slVerMat == ( NULL ) ) { status = 1 ; } else { status = mxGetString (
slVerMat , slVerChar , 10 ) ; } } mxDestroyArray ( slStrMat ) ;
mxDestroyArray ( slVerStructMat ) ; if ( ( status == 1 ) || ( strcmp (
slVerChar , "24.1" ) != 0 ) ) { return ; } } ssSetOptions ( S ,
SS_OPTION_EXCEPTION_FREE_CODE ) ; if ( ssGetSizeofDWork ( S ) != ( SLSize )
sizeof ( DW_TI_C2000_MotorControl_T ) ) { static char msg [ 256 ] ; snprintf
( msg , 256 , "Unexpected error: Internal DWork sizes do "
"not match for accelerator mex file (%ld vs %lu)." , ( signed long )
ssGetSizeofDWork ( S ) , ( unsigned long ) sizeof (
DW_TI_C2000_MotorControl_T ) ) ; ssSetErrorStatus ( S , msg ) ; } if (
ssGetSizeofGlobalBlockIO ( S ) != ( SLSize ) sizeof (
B_TI_C2000_MotorControl_T ) ) { static char msg [ 256 ] ; snprintf ( msg ,
256 , "Unexpected error: Internal BlockIO sizes do "
"not match for accelerator mex file (%ld vs %lu)." , ( signed long )
ssGetSizeofGlobalBlockIO ( S ) , ( unsigned long ) sizeof (
B_TI_C2000_MotorControl_T ) ) ; ssSetErrorStatus ( S , msg ) ; } { int
ssSizeofParams ; ssGetSizeofParams ( S , & ssSizeofParams ) ; if (
ssSizeofParams != sizeof ( P_TI_C2000_MotorControl_T ) ) { static char msg [
256 ] ; snprintf ( msg , 256 ,
"Unexpected error: Internal Parameters sizes do "
"not match for accelerator mex file (%d vs %lu)." , ssSizeofParams , (
unsigned long ) sizeof ( P_TI_C2000_MotorControl_T ) ) ; ssSetErrorStatus ( S
, msg ) ; } } _ssSetModelRtp ( S , ( real_T * ) &
TI_C2000_MotorControl_rtDefaultP ) ; _ssSetConstBlockIO ( S , &
TI_C2000_MotorControl_rtInvariant ) ; } static void mdlInitializeSampleTimes
( SimStruct * S ) { slAccRegPrmChangeFcn ( S , mdlOutputsTID1 ) ; } static
void mdlTerminate ( SimStruct * S ) { }
#include "simulink.c"
